const express = require('express')
const router = express.Router()
const { createArticleController,
    getFollowArticleController,
    getArticleController,
    getArticlesController,
    updateArticleController,
    deleteArticleController,
} = require('../controller/articles')
const authMiddleware = require('../middleware/index/authMiddleware')


/* 
标签路由地址和控制器映射
*/
router.post('/', authMiddleware, createArticleController)  //获标签列表
router.get('/follow', authMiddleware, getFollowArticleController)  //获标关注者文章
router.get('/:slug', getArticleController)  //获标单篇文章
router.get('/', getArticlesController)  //获标全局文章
router.put('/:slug', authMiddleware, updateArticleController)  //更新签列表
router.delete('/:slug', authMiddleware, deleteArticleController)  //删除签列表

// 导出路由模块
module.exports = router